package com.jdrx.sw.sewage.service;

import com.jdrx.platform.commons.rest.beans.dto.IdDTO;
import com.jdrx.platform.commons.rest.beans.vo.ResponseVO;
import com.jdrx.platform.commons.rest.factory.ResponseFactory2;
import com.jdrx.sw.sewage.beans.dto.LogoSetDTO;
import com.jdrx.sw.sewage.beans.entity.LogoSetPO;
import com.jdrx.sw.sewage.beans.vo.LogoSetVO;
import com.jdrx.sw.sewage.dao.LogoSetDAO;
import com.jdrx.sw.sewage.service.base.BaseServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogoSetServiceImpl extends BaseServiceImpl {

    public static final Logger logger = LoggerFactory.getLogger(LogoSetServiceImpl.class);

    @Autowired
    private LogoSetDAO logoSetDAO;

    public LogoSetVO findLogo() {
        return logoSetDAO.findLogo();
    }

    public ResponseVO add(LogoSetDTO logoSetDTO) {
        LogoSetPO po = new LogoSetPO();
        po.setId(logoSetDTO.getId());
        po.setDeleteFlag(0);
        po.setLogoPath("'" + logoSetDTO.getLogoPath() + "'");
        logoSetDAO.add(po);
        return ResponseFactory2.ok();
    }

    public void update(LogoSetDTO logoSetDTO) {
        LogoSetPO po = new LogoSetPO();
        po.setId(logoSetDTO.getId());
        po.setDeleteFlag(0);
        po.setLogoPath("'" + logoSetDTO.getLogoPath() + "'");
        logoSetDAO.update(po);
    }

    public void delete(IdDTO dto) {
        logoSetDAO.delete(dto);
    }
}
